package com.dup.jxlh.api.enums;

public enum ChapterTypeEnum {
    COMPANY(1, "公司公章"),
    CONTRACT(2, "合同专用章"),
    PROJECT(3, "项目专用章"),
    REPORT(4, "报告专用章"),
    FINANCE(5, "财务专用章"),
    BILL(6, "发票专用章"),
    LEGAL(7, "法定代表人章");

    private Integer code;
    private String name;

    ChapterTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        for (ChapterTypeEnum stateEnum: values()){
            if(stateEnum.getCode() == code){
                return stateEnum.getName();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
